<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2016/6/8
  Time: 8:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="/wechat/public/css/jquery.mobile-1.4.2.min.css">
    <link rel="stylesheet" href="/wechat/order/myPraise.css">
    <jsp:include page="../public/head.jsp" flush="true" />
    <script src="/wechat/public/js/jquery.mobile-1.4.2.min.js"></script>

</head>
<body>
<%--订单号：${order.orderNo}--%>
<form id="form" onsubmit="return false">
<input type="hidden" name="orderId" value="${order.id}">
<input type="hidden" name="accountId" value="${userinfo.id}">
<%--<input type="number" name="tasteScore"  title="评分"><br>--%>
<%--<input type="number" name="speedScore" ><br>--%>
<%--评价<input type="text" name="content" >--%>
<%--<input type="button" value="提交评论" onclick="comment()">--%>
<%--</form>--%>
<jsp:include page="../public/header.jsp" flush="true" />
<section>
    <div class="my_myPraise">
        <!-- 订单状态：代付款、未评价、交易成功 GO -->
        <div class="status_list first">
            <div class="tit">订单号:${order.orderNo}</div>
            <div class="goodscont">
                <div class="goods_pic"><img src="${orderInfo.productImage}"></div>
                <div class="goods_name">
                    <div class="text1">${orderInfo.productName}</div>
                    <%--<div class="text1">05-09（周一）</div>--%>
                    <div class="text1 last">￥${order.totalPrice}</div>
                </div>
            </div>
        </div>
        <!--/status_list  END -->
        <div class="info">
            <div class="i_t">
                <div class="tip"> <span class="s1">早餐美味</span> <span class="s2" id="rt1">5分</span></div>
                <div class="opra">
                    <!--线上脚本-->
                    <%--<input type='range' id='r1' class='tip fill fill-replace hide' value='0' min='0' max='5' />--%>
                    <input type='range' name="tasteScore" id='r1' class='tip fill' value='5'  min='0' max='5' data-highlight="true" onchange="change('rt1',this)"/>
                    <!--/线上脚本-->
                </div>
            </div>
            <div class="clear"></div>
            <div class="i_t">
                <div class="tip"> <span class="s1">快递服务</span> <span class="s2" id="rt2">5分</span></div>
                <div class="opra">
                    <input type='range' name="tasteScore" id='r2' class='tip fill' value='5'  min='0' max='5' data-highlight="true" onchange="change('rt2',this)"/>
                </div>
            </div>
        </div>

        <%--<form>--%>
            <div class="txt">
                <input type="textarea" name="content" id="content" class="txt1"  placeholder="请输入您的评价" oninput="textCount()">
                <div class="txt2" id="tip">0/100字</div>
            </div>
            <div class="out">
                <%--<input type="button" name=""  value="我要评论" onclick="comment()">--%>
                <button onclick="comment()">我要评论</button>
            </div>
    </div>
    <!--/my_list -->
</section>
</form>

<footer> <div  class="my_ocupie"></div> </footer>
<script>
    function change(id,_this) {
        $("#"+id).text($(_this).val()+"分");
    }
    $("#r1").hide();
    $("#r2").hide();

    function textCount(){
        var text  =    $("#content").val();
        var counter  =    text.length;

        $("#tip").text((counter)+"/100字");
    };

    function comment() {
        if ($("#content").val() == 0){
            tip("","请输入反馈内容",true);
            return;
        }
//        console.log($("#form").serialize());
        $.post("/mobile/user/order?action=comment",$("#form").serialize(),function (data) {
            if (!data.success){
                tip("",data.msg,true);
            }else {
                window.location.replace("/order/orderList.do");
            }
        },"json");
    }
</script>
</body>
</html>
